import qs from 'qs';

import { request } from '@/utils/http';
const api = {
	conditioningRecordsList: '/conditioningRecords/list',
	conditioningRecordsDetail: '/conditioningRecords/',
	positionList: '/position/list',
	symptomList: '/symptom/list',
	conditioningSchemeList: '/conditioningScheme/list',
	conditioningSchemeDetail: '/conditioningScheme/',
	startConditioning: '/conditioningRecords/startConditioning',
	endConditioning: '/conditioningRecords/endConditioning',
	startConditioningDetail: '/conditioningRecords/startConditioningDetail',
	suspendConditioningDetail: '/conditioningRecords/suspendConditioningDetail',
	continueConditioningDetail: '/conditioningRecords/continueConditioningDetail',
	endConditioningDetail: '/conditioningRecords/endConditioningDetail',
	fiveElementsList: '/scheme/fiveElements/list',
	noFinishedList: '/conditioningRecords/noFinishedList',
	classificationList: '/scheme/classification/list'
}

/**
 * @description 获取未完成的调理记录列表
 * @param {Object} params - 参数
 */
export const noFinishedList = () => request.get(api.noFinishedList);

/**
 * @description 获取五行列表
 * @param {Object} params - 参数
 */
export const fiveElementsList = (params) => request.get(`${api.fiveElementsList}?${qs.stringify(params)}`);

/**
 * @description 获取调节记录列表
 * @param {Object} params - 参数
 */
export const conditioningRecordsList = () => request.get(api.conditioningRecordsList);

/**
 * @description 获取调节记录详情
 * @param id - 参数
 */
export const conditioningRecordsDetail = (id) => request.get(`${api.conditioningRecordsDetail}${id}`);

/**
 * @description 删除调理申请
 * @param id - 参数
 */
export const conditioningRecordsDelete = (id) => request.delete(`${api.conditioningRecordsDetail}${id}`, {});

/**
 * @description 获取部位列表
 * @param {Object} params - 参数
 */
export const positionList = (params) => request.get(`${api.positionList}?${qs.stringify(params)}`);

/**
 * @description 获取症状列表
 * @param {Object} params - 参数
 */
export const symptomList = (params) => request.get(`${api.symptomList}?${qs.stringify(params)}`);

/**
 * @description 查询方案分类列表
 * @param {Object} params - 参数
 */
export const classificationList = (params) => request.post(`${api.classificationList}`, params);

/**
 * @description 根据调理记录获取方案列表
 * @param {Object} params - 参数
 */
export const conditioningSchemeList = (params) => request.get(`${api.conditioningSchemeList}/${params}?paginationRequired=false`);

/**
 * @description 根据部位和症状获取方案列表
 * @param {Object} params - 参数
 */
export const conditioningSchemeList1 = (params) => request.get(`${api.conditioningSchemeList}?${qs.stringify(params)}`);

/**
 * @description 获取调理方案详情
 * @param {Object} params - 参数
 */
export const conditioningSchemeDetail = (params) => request.get(`${api.conditioningSchemeDetail}${params}`);

/**
 * @description 开始调理 - 确认方案 整个记录的开始
 * @param {Object} params - 参数
 */
export const startConditioning = (params) => request.put(api.startConditioning, params);

/**
 * @description 结束调理 - 停止调理 整个记录的结束
 * @param {Object} params - 参数
 */
export const endConditioning = (params) => request.put(api.endConditioning, params);

/**
 * @description 开始调理穴位 - 每一组穴位的开始
 * @param {Object} params - 参数
 */
export const startConditioningDetail = (params) => request.put(`${api.startConditioningDetail}`, params);

/**
 * @description 暂停调理穴位 - 每一组穴位的暂停
 * @param {Object} params - 参数
 */
export const suspendConditioningDetail = (params) => request.put(`${api.suspendConditioningDetail}`, params);

/**
 * @description 继续调理穴位 - 每一组穴位的继续
 * @param {Object} params - 参数
 */
export const continueConditioningDetail = (params) => request.put(`${api.continueConditioningDetail}`, params);

/**
 * @description 结束调理穴位 - 每一组穴位的结束
 * @param {Object} params - 参数
 */
export const endConditioningDetail = (params) => request.put(`${api.endConditioningDetail}`, params);